using UnityEngine;

public class SensitivityChanger3DTouch : MonoBehaviour
{
	private UISlider slider;

	public GameObject shoot3DTouchEnabled;

	public GameObject shoot3DTouchDisabled;

	private void Awake()
	{
		slider = GetComponent<UISlider>();
		slider.value = 1f - settings.Sensivity3DTouch;
		if (settings.shoot3DtouchDisabled)
		{
			shoot3DTouchEnabled.SetActive(false);
			shoot3DTouchDisabled.SetActive(true);
		}
		else
		{
			shoot3DTouchEnabled.SetActive(true);
			shoot3DTouchDisabled.SetActive(false);
		}
		if (!UICamera.touchPressureSupported)
		{
			base.gameObject.SetActive(false);
		}
	}

	public void OnValueChange()
	{
		if (slider.value > 0.99f)
		{
			slider.value = 0.99f;
		}
		else if (slider.value < 0.01f)
		{
			slider.value = 0.01f;
		}
		settings.Sensivity3DTouch = 1f - slider.value;
	}

	public void Toggle3DtouchShoot()
	{
		settings.shoot3DtouchDisabled = !settings.shoot3DtouchDisabled;
		if (settings.shoot3DtouchDisabled)
		{
			shoot3DTouchEnabled.SetActive(false);
			shoot3DTouchDisabled.SetActive(true);
		}
		else
		{
			shoot3DTouchEnabled.SetActive(true);
			shoot3DTouchDisabled.SetActive(false);
		}
	}
}
